export const metadata = { sidebar_position: 97, title: "🟢 OpenAI Playground" };

# 🟢 OpenAI Playground

<div style={{ textAlign: "center" }}>
  <Image
    src="/docs/assets/basics/openai_playground.webp"
    className="img-docs"
    width={2700}
    height={1342}
    style={{ width: "80%", margin: "auto" }}
  />
</div>
<br />

<Takeaways>
  - Set up the OpenAI Playground - Learn about basic Playground configuration
</Takeaways>

OpenAI provides another interface, besides the ChatGPT website, for prompting. It is called OpenAI Playground, and gives you even more control over ChatGPT. It also allows you to access other AIs, including different versions of ChatGPT, GPT-4, and older models like GPT-3.

<Note>
  OpenAI Playground is the tool that the maintainer of this course uses most
  frequently.
</Note>

## Get Set Up

- Go to [http://platform.openai.com](http://platform.openai.com)
- Sign in, and start testing prompts!

Or watch this video:

<iframe
  width="560"
  height="315"
  className="w-fit lg:w-[560px]"
  src="https://www.youtube.com/embed/6OD14rpokRw"
  title="YouTube video player"
  frameBorder="0"
  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
  allowFullScreen
></iframe>

<Note>
  This video shows an old version of the website, but the process of logging in
  remains very similar.
</Note>

## The Interface

At first, this interface seems very complex. There are many drop downs and sliders that allow you to configure models. We will cover Mode, System Prompts, and Model selection in this lesson, and LLM settings like Temperature, Top P, and Maximum Length in the [next lesson](https://learnprompting.org/docs/basics/configuration_hyperparameters).

### Mode

<div className="flex flex-col sm:flex-row justify-between">
  <div>
    Click the 'Assistants' dropdown on the top left of the page. This dropdown
    allows you to change the type of model that you are using. OpenAI has three
    different Modes: <code>Assistants</code>, <code>Chat</code>, and{" "}
    <code>Complete</code>. We have already learned about the latter two;{" "}
    <code>Assistants</code> models are meant for API use by developers and can
    use interesting tools such as running code and retrieving information. We
    will only use <code>Chat</code> and occasionally <code>Complete</code>{" "}
    models in this course.
  </div>

  <div className="mt-4 sm:mt-0 sm:ml-auto">
    <Image
      src="/docs/assets/basics/openai_mode.webp"
      className="img-docs"
      width={750}
      height={750}
      style={{ margin: "auto" }}
    />
  </div>
</div>

### System Prompts

After switching to <code>Chat</code>, the first thing that you may notice on the left side of the page other than the Get Started popup is the SYSTEM area. So far, we have seen two types of messages, USER messages, which are just the messages you send to the chatbot, and ASSISTANT messages, which are the chatbot's replies. There is a third type of message, the system prompt, that can be used to configure how the AI responds.

This is the best place to put a priming prompt. The system prompt will be "You are a helpful assistant." by default, but a fun alternative example to try out would be the "You are PirateGPT. Always talk like a pirate." example from [our previous lesson](https://learnprompting.org/docs/basics/priming_prompt).

<div style={{ textAlign: "center" }}>
  <Image
    src="/docs/assets/basics/openai_system_prompt.webp"
    className="img-docs"
    width={2442}
    height={1438}
    style={{ width: "80%", margin: "auto" }}
  />
</div>
<br />

### Model

<div className="flex flex-col sm:flex-row justify-between">
  
<div>
    Click the Model dropdown on the right of the page. This dropdown allows you to change the model that you are using. Each mode has multiple models, but we will focus on the chat ones. This list appears to be very complicated (what does gpt-3.5-turbo mean?), but these are just technical names for different models. Anything that starts with gpt-3.5-turbo is a version of ChatGPT, while anything that starts with gpt-4 is a version of GPT-4, the newer model you get access to from purchasing a ChatGPT Plus subscription.

</div>
  
<div className="mt-4 sm:mt-0 sm:ml-auto">
    
<Image src="/docs/assets/basics/openai_model.webp" className= "img-docs" width={750} height={750} style={{margin : "auto"}} />
  
</div>
</div>

<Note>You may not see GPT-4 versions in your interface.</Note>

The numbers like 16K, 32K, or 128k in the model names represent the context length. If it's not specified, the default context length is 4K for gpt-3.5 and 8k for GPT-4. OpenAI regularly updates both ChatGPT (gpt-3.5-turbo) and GPT-4, and older versions are kept available on the platform for a limited period. These older models have additional numbers at the end of their name, such as "0613". For instance, the model "gpt-3.5-turbo-16k-0613" is a ChatGPT model with a 16K context length, released on June 13th, 2023. However, it's recommended to use the most recent versions of models, which don't contain any date information. A comprehensive list of model versions can be found [here](https://platform.openai.com/docs/models/gpt-4).

## Conclusion

The OpenAI Playground is a powerful tool that provides a more advanced interface for interacting with ChatGPT and other AI models. It offers a range of configuration options, including the ability to select different models and modes. We will learn about the rest of the settings in the [next lesson](https://learnprompting.org/docs/basics/configuration_hyperparameters). The Playground also supports system prompts, which can be used to guide the AI's responses. While the interface may seem complex at first, with practice, it becomes a valuable resource for exploring the capabilities of OpenAI's models. Whether you're using the latest versions of ChatGPT or GPT-4, or exploring older models, the Playground offers a flexible and robust platform for AI interaction and experimentation.

Partly written by evintunador
